package com.mall.common.domain.component;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.mall.common.domain.BaseEntity;
import com.mall.common.enums.PayType;

/**
 * 支付方式
 */
@Entity
@Table(name = "s_payment_type")
public class PaymentTypeDomain extends BaseEntity {

	private static final long serialVersionUID = 4775435998996059640L;
	private String name;// 支付方式名称
	private ComponentDomain component;// 关联的支付组件
	private PayType payType;// 支付类型
	private Boolean available;//是否可用
	private String description;// 介绍
	private Set<PaymentLogDomain> log;//支付日志

	@Column(unique = true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "component_id")
	public ComponentDomain getComponent() {
		return component;
	}

	public void setComponent(ComponentDomain component) {
		this.component = component;
	}

	public PayType getPayType() {
		return payType;
	}

	public void setPayType(PayType payType) {
		this.payType = payType;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Boolean getAvailable() {
		return available;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "payType")
	public Set<PaymentLogDomain> getLog() {
		return log;
	}

	public void setLog(Set<PaymentLogDomain> log) {
		this.log = log;
	}

}
